## Table A7: Effects of Neighborhood Race and Income on Wait Times: Week Fixed Effects

## install.packages(c("tidyverse", "fixest"))
## library(tidyverse)

## SET WORKING DIRECTORY HERE
## setwd()

## Loading data
## load("dta.RData")

## Column 1
race_wait_across_wk <- feols(log_wait_time ~ factor(white_third) |
                                       city^open_week, data = dta, cluster = "geo")

## Column 2
race_wait_within_wk <- feols(log_wait_time ~ factor(white_third) |
                                       city_service^open_week, data = dta, cluster = "geo")

## Column 3
inc_wait_across_wk <- feols(log_wait_time ~ factor(inc_third) |
                                      city^ open_week, data = dta, cluster = "geo")

## Column 4
inc_wait_within_wk <- feols(log_wait_time ~ factor(inc_third) |
                                      city_service^ open_week, data = dta, cluster = "geo")

TableA7 = etable(race_wait_across_wk, race_wait_within_wk,
                 inc_wait_across_wk, inc_wait_within_wk,
                 signifCode = c("+" = 0.10, "*" = 0.05, "**" = 0.01, "***" = 0.001),
                 digits = 3, digits.stats = 3, fitstat = c("n","r2"))
